﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace HotelProject
{
    public partial class Register : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void CreateUserButton_Click(object sender, EventArgs e)
        {
            
                MySQLDatabaseConnector database = new MySQLDatabaseConnector();

                registeredUser userToAdd = new registeredUser() { userFirstName = FirstName.Text, userLastName = LastName.Text, userName = UserName.Text, userPassword = Password.Text, isAdmin = false };
               
                database.addUser(userToAdd);
                database.saveChanges();

               
            

            Response.Redirect("~/ThanksForRegistering.aspx");
        }

       
    }
}